<template>
  <div ref="encryptText" class="encryptText">
    <slot></slot>
  </div>
</template>

<script>
import html2canvas from 'html2canvas';

export default {
  name: "EncryptText",
  mounted() {
    this.encrypt()
  },
  methods: {
    encrypt() {
      let txt = this.$refs['encryptText']
      html2canvas(txt).then(canvas => {
        txt.replaceWith(canvas)
      });
      txt.style.display = 'none'
    }
  }
}
</script>

<style scoped>

</style>
